package fr.glre.tartopom;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class TournePomActivity extends Activity {

	Button tourneunpeuB;
	Button restaplatB;
	Button tourneviteB;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		tourneunpeuB = (Button) findViewById(R.id.tourneunpeuB);
		restaplatB = (Button) findViewById(R.id.restaplatB);
		tourneviteB = (Button) findViewById(R.id.tourneviteB);

		tourneunpeuB.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(getBaseContext(),
						TourneunpeuActivity.class);
				startActivity(intent);
				finish();
			}
		});

		restaplatB.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(getBaseContext(),
						RestaplatActivity.class);
				startActivity(intent);
				finish();
			}
		});

		tourneviteB.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				Intent intent = new Intent(getBaseContext(),
						TourneViteActivity.class);
				startActivity(intent);
				finish();
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.mainmenu, menu);

		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {

		switch (item.getItemId()) {
		case R.id.item1:
			System.exit(RESULT_OK);
			break;
		}

		return false;
	}
}